Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cumulus 200 #223

Merged
merged 8 commits into from
Feb 28, 2018
Merged

Cumulus 200 #223

merged 8 commits into from
Feb 28, 2018

Conversation

laurenfrederick
Copy link
Contributor

Summary: Start integration test prototype

Addresses CUMULUS-200: Integration test prototype

Changes

  • New integration test Cumulus package
  • CLI for testing the execution of a workflow
  • Run through workflow execution on a current Cumulus deployment and test for success/failure

Test Plan

Things that should succeed before merging.

  • Adhoc testing

Reviewers: @scisco @yjpa7145 @jennyhliu @sethvincent


program
.usage('TYPE COMMAND [options]')
.option('-s, --stack-name <stackName>', 'AWS Cloud Formation stack name', null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this command will fail if any of these options are not set, that should be detected and handled. Right now there is nothing checking to see if these options (all of which are necessary) are set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* @param {string} workflowName - workflow name
* @returns {string} - workflow arn
*/
async function getWorkflowArn(stackName, bucketName, workflowName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an async function. await is never used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

* @param {string} stackName - Cloud formation stack name
* @param {string} bucketName - S3 internal bucket name
* @param {string} workflowName - workflow name
* @returns {string} - workflow arn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns a promise. @returns {Promise.<string>} - workflow arn

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this change.

* @param {string} workflowName - workflow name
* @returns {Object} template as a JSON object
*/
async function getWorkflowTemplate(stackName, bucketName, workflowName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an async function, await is never used.

@marchuffnagle
Copy link
Contributor

Should there be tests for this code?


// Give this execution a unique name
parsedInput.cumulus_meta.execution_name = uuidv4();
parsedInput.cumulus_meta.workflow_start_time = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being set to null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk because I am a dum dum.

statusCheckCount++;
}

if (executionStatus === 'RUNNING' && statusCheckCount === executionStatusNumRetries) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for safety, statusCheckCount >= executionStatusNumRetries

}

if (executionStatus === 'RUNNING' && statusCheckCount === executionStatusNumRetries) {
console.log(`Execution status check timed out, exceeded ${executionStatusNumRetries} status checks.`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add // eslint-disable-line max-len at the end of this line so it doesn't complain that the line is too long. In the case of long strings, exceeding the max line length isn't a problem.

http://airbnb.io/javascript/#strings--line-length

* @param {string} bucketName - S3 internal bucket name
* @returns {Object} list as a JSON object
*/
async function getWorkflowList(stackName, bucketName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never used and should be removed.

Copy link
Contributor

@marchuffnagle marchuffnagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, only a few changes requested.

Copy link
Contributor Author

@laurenfrederick laurenfrederick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all the comments. I was thinking about tests to test the integration tests... what are you thinking, using localstack?

* @returns {boolean} - true if all params are not null
*/
function verifyWorkflowParameters(requiredParams) {
return requiredParams.map((param) => verifyRequiredParameter(param)).includes(false) === false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of requiredParams.map((param) => verifyRequiredParameter(param)), just requiredParams.map(verifyRequiredParameter).

* @returns {boolean} - true if all params are not null
*/
function verifyWorkflowParameters(requiredParams) {
return requiredParams.map((param) => verifyRequiredParameter(param)).includes(false) === false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little easier to read if it's written as return !requiredParams.map(verifyRequiredParameter).includes(false);, but that could just be my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fundamentally opposed to the !

Copy link
Contributor

@marchuffnagle marchuffnagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a couple additional comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants